#define EXT_READ_COMMAND(command) va_list vl;va_start(vl, argc);*command = va_arg(vl, wxString);va_end(vl);
#define EXT_SELECTED_ITEM(item_selected) va_list vl;va_start(vl, argc);*item_selected = va_arg(vl, int);va_end(vl);
#define EXT_SELECTED_ITEM_TYPE(item_type) va_list vl1;va_start(vl1, argc);*item_type = va_arg(vl1, int);*item_type = va_arg(vl1, int);va_end(vl1);
#define EXT_CONNECT(object, event, id) (GetAPI()->_connect((void*)object, (void*)(&(event)), id))
#define EXT_CONNECT_SLIDER_ALL_EVENTS(object, id) \
			EXT_CONNECT(object, wxEVT_SCROLL_TOP, id);					\
			EXT_CONNECT(object, wxEVT_SCROLL_BOTTOM, id);				\
			EXT_CONNECT(object, wxEVT_SCROLL_LINEUP, id);				\
			EXT_CONNECT(object, wxEVT_SCROLL_LINEDOWN, id);				\
			EXT_CONNECT(object, wxEVT_SCROLL_PAGEUP, id);				\
			EXT_CONNECT(object, wxEVT_SCROLL_PAGEDOWN, id);				\
			EXT_CONNECT(object, wxEVT_SCROLL_THUMBTRACK, id);			\
			EXT_CONNECT(object, wxEVT_SCROLL_THUMBRELEASE, id);			\
			EXT_CONNECT(object, wxEVT_SCROLL_CHANGED, id);					
#define EXT_AUIEVENTS(pane_name) (GetAPI()->_reg_pane(pane_name, this->GetID()))
#define EXT_CID(id) ((GetID()) * 100 + id + 20000)
#define EXT_GET_AUIPANE(name) (((wxAuiManager*)GetAPI()->_get_auimanager())->GetPane(name))
#define EXT_UPDATEAUI() (GetAPI()->_update_auimanager())
#define EXT_UPDATEAUI_IN_TAB(tab) (GetAPI()->_update_auimanager(tab))
#define EXT_ADD_GUI( item , id , pane_info , caption , add_to_menu, manager )	\
			GetAPI()->_add_gui_item(									\
				(void*)(item),											\
				(id),													\
				(void*)(pane_info),										\
				(caption),												\
				add_to_menu,											\
				manager)

#define AUIPANEI( properties ) \
	&((new wxAuiPaneInfo())->properties)
#define EXT_FORCE_UPDATEAUI( dialog ) \
										if(dialog->IsShown())									\
										{														\
											GetAPI()->_update_pane((void*)dialog, 1);			\
											if(dialog->IsDocked()){								\
											GetAPI()->_update_pane((void*)dialog, 2); }			\
											else{												\
											GetAPI()->_update_pane((void*)dialog, 3); }			\
											EXT_UPDATEAUI();									\
											if(dialog->IsDocked())								\
											{													\
												GetAPI()->_update_pane((void*)dialog, 2);		\
											}else{												\
											GetAPI()->_update_pane((void*)dialog, 3); }			\
										}														\
																								\
										if(dialog->IsFloating())								\
										{														\
											GetAPI()->_update_pane((void*)dialog, 3); 			\
											EXT_UPDATEAUI();									\
											GetAPI()->_update_pane((void*)dialog, 2); 			\
										}														\
										GetAPI()->_update_pane((void*)dialog);					\
										EXT_UPDATEAUI();
#define COMMAND(command) GetAPI()->_console(command)
#define trace(message) GetAPI()->_print_to_log(message)
#define GetMainWindow() ((wxWindow*)(GetAPI()->GetParentWindow()))